<template>
  <div class="all">
    <el-tree
      :data="data"
      show-checkbox
      node-key="id"
      default-expand-all
      :expand-on-click-node="false">
      <span class="custom-tree-node" slot-scope="{ node, data }">
        <span>{{ data.label }}</span>
        <span class="button">
          <el-button
            type="text"
            size="mini">
            修改
          </el-button>
          <el-button
            type="text"
            size="mini"
            @click="() => remove(node, data)">
            删除
          </el-button>
        </span>
      </span>
    </el-tree>
  </div>
</template>

<script>
export default {
    data() {
      return {
        data: [{
          id: 1,
          label: '新品',
          children: [{
            id: 4,
            label: 'CGLDG系列'
          },{
            id: 5,
            label:'BZDZLLY系列',
          }]
        }, {
          id: 2,
          label: '高端定制',
          children: [{
            id: 6,
            label: '轻奢家居'
          }, {
            id: 7,
            label: '意式极简'
          }]
        }, {
          id: 3,
          label: '展厅现货',
          children: [{
            id: 8,
            label: '现代极简'
          }]
        }],
      };
    }
  };
</script>

<style scoped>
.all{
  width: 100%;
  height: 100%;
  background: #fff;
}
.button{
  position: absolute;
  margin-left: 5%;
}
/* .el-tree-node__content{
  display: flex;
  align-items: center;
  height: 100px;
  cursor: pointer;
} */
</style>